<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>跳动爱心</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    /* 让容器的高度宽度都充满全屏 */
    html,
    body {
        width: 100%;
        height: 100%;
    }

    body {
        background-color: pink;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .center {
        width: 200px;
        height: 200px;
        background-color: red;
        position: relative;
        transform: rotate(45deg);
        animation: hearbit 1.5s alternate infinite;
        box-shadow: 0 0 30px red;
    }

    .center>p {
        transform: rotate(-45deg);
        font-size: 30px;
        color: white;
        text-shadow: 0 0 30px white;
    }

    .center::before {
        content: " ";
        width: 200px;
        height: 100px;
        background-color: red;
        position: absolute;
        left: 0;
        top: -99px;
        border-radius: 100px 100px 0 0;
        box-shadow: 0 0 30px red;
    }

    .center::after {
        content: " ";
        width: 100px;
        height: 200px;
        background-color: red;
        position: absolute;
        left: -99px;
        top: 0;
        border-radius: 100px 0 0 100px;
        box-shadow: 0 0 30px red;
    }

    @keyframes hearbit {
        0% {
            transform: rotate(45deg) scale(0.6);
        }

        /* 25%{
            transform: rotate(45deg) scale(0.8);
        }
        50%{
            transform: rotate(45deg) scale(1);
        }
        75%{
            transform: rotate(45deg) scale(1.2);
        } */
        100% {
            transform: rotate(45deg) scale(1.4);
        }
    }
</style>

<body>
    <div class="center">
        <p>跳动的心</p>
    </div>
</body>

</html>